
/**
 * First we will load all of this project's JavaScript dependencies which
 * includes Vue and other libraries. It is a great starting point when
 * building robust, powerful web applications using Vue and Laravel.
 */
require('./bootstrap')
window.Vue = require('vue');
window.Axios = require('axios');
import Register from './components/Register.vue'
import Home from './components/Home.vue'
import List from './components/List.vue'
import WHeader from './components/Header.vue'
import Detail from './components/Detail.vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)
Vue.component('w-header',WHeader)
const routes = [
    { path: '/register', component: Register },
    { path: '/home', component: Home },
    { path: '/list', component: List },
    { path: '/detail/:id', component:  Detail},
]

// 3. 创建 router 实例，然后传 `routes` 配置
// 你还可以传别的配置参数, 不过先这么简单着吧。
const router = new VueRouter({
    mode: 'history',
    routes // （缩写）相当于 routes: routes
})


/**
 * Next, we will create a fresh Vue application instance and attach it to
 * the page. Then, you may begin adding components to this application
 * or customize the JavaScript scaffolding to fit your unique needs.
 */


const app = new Vue({
    router
}).$mount('#app')